package com.ljt.entity;

import javax.persistence.*;

/**
 * Created by wb-ljt251780 on 2017/7/20.
 */
@Entity
@Table(name = "tb_options")
public class OptionsEntity {
    private long id;
    private String description;
    private String optionKey;
    private String optionValue;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "description", nullable = true, insertable = true, updatable = true, length = 255)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "option_key", nullable = true, insertable = true, updatable = true, length = 255)
    public String getOptionKey() {
        return optionKey;
    }

    public void setOptionKey(String optionKey) {
        this.optionKey = optionKey;
    }

    @Basic
    @Column(name = "option_value", nullable = true, insertable = true, updatable = true, length = 255)
    public String getOptionValue() {
        return optionValue;
    }

    public void setOptionValue(String optionValue) {
        this.optionValue = optionValue;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        OptionsEntity that = (OptionsEntity) o;

        if (id != that.id) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (optionKey != null ? !optionKey.equals(that.optionKey) : that.optionKey != null) return false;
        if (optionValue != null ? !optionValue.equals(that.optionValue) : that.optionValue != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (optionKey != null ? optionKey.hashCode() : 0);
        result = 31 * result + (optionValue != null ? optionValue.hashCode() : 0);
        return result;
    }
}
